package com.oa.srms.apps.dao.student.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.oa.srms.apps.dao.student.IScoreInfoDao;
import com.oa.srms.apps.entity.student.ScoreInfoValue;

public class ScoreInfoDaoImpl extends HibernateDaoSupport implements IScoreInfoDao {

	@Override
	public Integer addScoreInfo(ScoreInfoValue scoreInfoValue) throws Exception {
		if(scoreInfoValue != null){
			this.getHibernateTemplate().save(scoreInfoValue);
		}
		return scoreInfoValue.getId();
	}

	@Override
	public void editScoreInfo(ScoreInfoValue scoreInfoValue) throws Exception {
		if(scoreInfoValue != null){
			this.getHibernateTemplate().update(scoreInfoValue);
		}

	}

	@Override
	public ScoreInfoValue queryById(Integer id) throws Exception {
		return (ScoreInfoValue) this.getHibernateTemplate().get(ScoreInfoValue.class, id);
	}
	
}
